﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Search.aspx.cs" Inherits="PlugNT.Cms.Web.Search" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<%@ Register Src="Control/Foot.ascx" TagName="Foot" TagPrefix="uc1" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <% =PlugNT.Cms.Page.DataHelper.GetFile("/templet/include/_head2.htm")%>
    <link rel="stylesheet" type="text/css" href="/Css/home.css" />
    <link rel="stylesheet" type="text/css" href="/Css/SupplyStyle.css" />
    <script type="text/javascript" src="/Js/jquery.js"></script>
    <script type="text/javascript" src="/Js/show.js"></script>
</head>
<body>
    <% =PlugNT.Cms.Page.DataHelper.GetFile("/templet/include/_toper.htm")%>
    <div id="container2">
        <% =PlugNT.Cms.Page.DataHelper.GetFile("/templet/include/_top.htm")%>
        <% 
            string key = Request.QueryString["key"] != null ? Request.QueryString["key"].ToString() : "";
            DateTime dtBeing = DateTime.Now;
            int recordCount = 0;
            int page = 1;
            System.Data.DataTable datalist = PlugNT.Cms.Page.DataHelper.GetContentTable(12, page, "publish", "addtime desc", " and title like '%" + key + "%'", "", out recordCount); %>
        <!-----------search--------------->
        <div class="clear">
        </div>
        <div class="Crumbs">
            <ul>
                <li class="result">找到相关网页约<span><%=recordCount.ToString()%></span>篇，用时<span><%=(DateTime.Now.Ticks-dtBeing.Ticks)/1000%></span>秒
                </li>
            </ul>
            <div class="clear">
            </div>
        </div>
        <!-------------引导---------------->
        <div class="detail_list">
            <div class="content_article">
                <%  
                    if (Request.QueryString["page"] != null)
                    {
                        page = Convert.ToInt32(Request.QueryString["page"]);
                    }

                    for (int i = 0; i <= datalist.Rows.Count - 1; i++)
                    {%>
                <dl class="search_list">
                    <dt><a target="_search" href='<%=datalist.Rows[i]["createpath"].ToString() + datalist.Rows[i]["pagename"] %>.shtml'>
                        <%=this.ReplaceTitle(datalist.Rows[i]["title"].ToString())%></a></dt>
                    <dd class="search_txt">
                        <%=FJASPX.Framwork.Helper.StringHelper.CutString(FJASPX.Framwork.Helper.StringHelper.ClearHtml(datalist.Rows[i]["contents"].ToString()), 400)%></dd>
                    <dd class="search_attribute">
                        http://<%=Request.Url.Host+datalist.Rows[i]["createpath"].ToString() + datalist.Rows[i]["pagename"].ToString().Replace("' target='_blank' p='","")%>.shtml
                        <%= Convert.ToDateTime(datalist.Rows[i]["addtime"]).ToShortDateString()%></dd>
                </dl>
                <%
}  
                %>
                <div class="clear">
                </div>
                <br />
                <div class="pager">
                    <%  
                        Response.Write(PlugNT.Cms.Page.DataHelper.GetPagination(recordCount, 12, page, "Search.aspx", "key=" + (string.IsNullOrEmpty(Request.QueryString["key"]) ? "" : Request.QueryString["key"].ToString()) + "&page",
                    "", false, false));%>
                </div>
            </div>
        </div>
    </div>
    <div class="clear">
    </div>
    <div class="out-footer">
        <div class="footer">
            <uc1:Foot ID="Foot1" runat="server" />
        </div>
    </div>
</body>
</html>
